package com.wish.housing.controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wish.common.core.web.domain.AjaxResult;
import com.wish.housing.entity.tenant.PageMTenantRequestDTO;
import com.wish.housing.entity.tenant.PageMTenantResponseDTO;
import com.wish.housing.service.IMTenantService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 崔 - 租客管理
 * </p>
 *
 * @author xiaocui
 * @since 2022-03-28
 */
@RestController
@RequestMapping("/tenant")
public class MTenantController {

    @Autowired
    private IMTenantService imTenantService;

    /*
     * 租客管理列表
     * */
    @GetMapping(value = "/searchTenantManageList")
    public AjaxResult cfTerminationDtoList(PageMTenantRequestDTO pageMTenantRequestDTO) {
        IPage<PageMTenantResponseDTO> page = new Page<>(pageMTenantRequestDTO.getPageNum(), pageMTenantRequestDTO.getPageSize());
        page = imTenantService.searchTenantManageList(page, pageMTenantRequestDTO);
        return AjaxResult.success(page);
    }


    /**
     * @Date 2022/3/30 18:36
     * @deprecated 房源报表
     **/
    @GetMapping(value = "/getSearchMessage")
    public AjaxResult getSearchMessage() {
        Integer signType = 1;
        Long a = imTenantService.getTenantOne(signType);
        signType = 2;
        Long b = imTenantService.getTenantOne(signType);
        signType = 3;
        Long c = imTenantService.getTenantOne(signType);
        Map<String, Object> map = new HashMap<>();
        map.put("a", a);
        map.put("b", b);
        map.put("c", c);
        return AjaxResult.success(map);
    }
}
